home *** CD-ROM | disk | FTP | other *** search
- // ===============================================================
- // Vertex Program:
- // Description:
- // Last Update: 14/08/2003
- // Coder: Andrey Honich
- // ===============================================================
-
- #include "../CGVPMacro.csi"
-
-
- VertAttributes { POSITION_3 TEXCOORD0_2 TANG_3X3 }
- MainInput { VIEWPROJ_MATRIX, LIGHT_MATRIX, LIGHT_POS, ATTEN }
- DeclarationsScript
- {
- IN_T0_C0_TANG
- OUT_T0_T1_T2_T3_C0_C1
- }
- PositionScript = PosCommon
- CoreScript
- {
- OUT.Tex0.xy = IN.TexCoord0.xy;
- OUT.Tex1.xy = IN.TexCoord0.xy;
- OUT.Tex3 = mul(LightMatrix, vPos);
-
- TANG_MATR
-
- // store normalized light vector
- float3 lightVec = LightPos.xyz - vPos.xyz;
- float fiSqDist = rsqrt(dot(lightVec, lightVec));
-
- OUT.Color1.xyz = PROC_ATTENVERT;
- OUT.Tex2.xyz = mul(objToTangentSpace, lightVec);
- OUT.Color = IN.Color;
- }
-